//
//  OrderAddress.swift
//  Fancyswap
//
//  Created by Cheikh Bara on 2015-04-19.
//  Copyright (c) 2015 Jonathan Muschalle. All rights reserved.
//

import UIKit

class OrderAddress {
    
    var firstName:  String = ""
    var lastName:   String = ""
    var city:       String = ""
    var country:    String = ""
    var zip:        String = ""
    var address:    String = ""
    var state:      String = ""
    
    init(){}
    
    init(firstName: String, lastName: String, city: String, country: String, zip: String, address: String, state: String){
        self.firstName = firstName
        self.lastName  = lastName
        self.city      = city
        self.country   = country
        self.zip       = zip
        self.address   = address
        self.state     = state
    }
    
    
    init(dic: NSDictionary) {
        for elem in dic {
            switch (elem.key as String) {
                case "firstname":   self.firstName = elem.value as String
                case "lastname":    self.lastName  = elem.value as String
                case "city":        self.city      = elem.value as String
                case "country":     self.country   = elem.value as String
                case "zip":         self.zip       = elem.value as String
                case "address":     self.address   = elem.value as String
                case "state":       self.state     = elem.value as String
                default:            println("Unknown element: \(elem.key as String)")
            }
        }
    }
    
}
